package com.demo.cloud.controller;

import com.demo.cloud.vo.UserVo;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("demo")
public class DemoController {

    @GetMapping("hello")
    public String hello(@RequestParam String name) {
        return "hello," + name;
    }

    @PostMapping("changeUser")
    public UserVo changeName(@RequestBody UserVo vo) {
        System.out.println(vo.toString());
        vo.setName("service-1" + vo.getName());
        return vo;
    }
}
